package cn.wsn2018.tools.dao;

import cn.wsn2018.tools.model.User;

import java.io.UnsupportedEncodingException;
import java.util.List;

/**
 * Created by NZX on 2018/11/19.
 */
public interface UserDao{
    List<User> listAllUsers(String pageNum,String pageSize);
    List<User> listUsersByRole(String role,String pageNum,String pageSize);
    User getUserByName(String username);
    boolean saveUser(User user);
    boolean deleteUser(String username);
    boolean updateUser(String formerName,User user);


    List<User> listSecUsers(String pageNum, String pageSize, String role, String type, String state,String username,String lock,String permission);
    Long  countSecUsers(String role, String type, String state,String username,String lock,String permission);
    List<User> listSecUsers();
    List<User> listTemporarySecUsers();
    List<User> listLockedSecuser();
    List<User> listActiveSecuser();
    List<User> listSleepSecuser();
    boolean removeSecUserById(String id);
    boolean sleepSecUserById(String id);
    boolean activeSecUserById(String id);
    boolean lockSecUserById(String id);
    boolean unlockSecUserById(String id);
    boolean givePermissionSecUserById(String id);
    boolean askPermissionSecUserByName(String username);
    boolean removePermissionSecUserById(String id);
    int resetSecUserPasswordByid(String id) throws UnsupportedEncodingException;
    boolean updateSecUserInfo(String id,String idCard,String phone,String role,Integer type,Integer accesssTime,String ipAddress);
    User getSecUserById(String id);
    boolean setLastLoginTime(String id);
    Integer isHasSleepUserWillOverYear();


}
